
<?php
	include "../admin/p_usuario/valida_credenciais.php";
	
	$valCr = new valida_credenciais();
	$nivel = array(1);
	if(!($valCr->validar($nivel))){
		header('Location: index.php?pg=denied');
	}

?>

<script language="javascript" type="text/javascript" src="../admin/p_guia/valida_form.js"></script>
<div class="form">

	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h2>Adicionar Empresa</h2>
			</div>
		</div>
	</div>
	<div class="row">
	<div class="col-md-3">
			<div class="actions">
				<div class="panel panel-default">
					<div class="panel-heading"><h5>Op&ccedil&otildees</h5></div>
						<div class="panel-body">
							<ul class="nav nav-pills nav-stacked">
								<li><a href="index.php?pg=empresas">Listar Empresas</a></li>
								
							</ul>
						</div>
					</div>
				</div>			
		</div><!-- end col md 3 -->
		<div class="col-md-9">
		<!-- HEAD DE FORMULÃ�RIO -->
		<div class="panel panel-default">
			<div class="panel-heading"><h5>Formul&aacuterio de Cadastro de Empresas</h5></div>
			<div class="panel-body">
			<!-- FORMULÃ�RIO -->
			<form  method="post" name="form1" action="../admin/p_guia/salvar.php" enctype="multipart/form-data">
				<div class="row">
					<div class="col-md-12 form-group"><h6>(<span class="text-danger">*</span>) Campos de preenchimento obrigat&oacuterio.</h6></div>
				</div>
				<div class="row">
					<div class="form-group col-md-9">
						<label for="empresa">Empresa (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" name="empresa" id="empresa" placeholder="Informe o nome da Empresa...">
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-7">
						<label for="endereco">Endere&ccedilo (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" id="endereco" name="endereco" placeholder="Informe o endere&ccedil;o da Empresa...">
					</div>
					<div class="form-group col-md-2">
						<label for="cep">CEP (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" id="cep" name="cep" maxlength="10" onkeypress="MascaraCep(form1.cep);" onBlur="ValidaCep(form1.cep)">
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-9">
						<label for="fanpage">Fanpage</label>
    					<input type="text" class="form-control" name="fanpage" id="fanpage" placeholder="Informe a fanpage da Empresa...">
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-9">
						<label for="link">Link(Site da empresa)</label>
    					<input type="text" class="form-control" name="link" id="link" placeholder="Informe o link do site da Empresa...">
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-3">
						<label for="tel">Telefone</label>
    					<input type="text" class="form-control" id="tel" name="tel" placeholder="(67) 0000-0000" maxlength="14" onkeypress="MascaraTelefone(form1.tel);" >
					</div>
					<div class="form-group col-md-6">
						<label for="email">Email (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" id="email" name="email" placeholder="email@email.com">
					</div>
				</div>
				<div class="row">
					<div class="form-group col-md-6">
						<label for="categoria">Categoria (<span class="text-danger">*</span>)</label>
    					<select name="categoria" id="categoria" class="form-control">
		          			<option value='selecione'>Selecione...</option>
		          			<?php
									$query = mysql_query("SELECT `id_categoria`, `nome_categoria`, `status` FROM `categorias` WHERE `status` LIKE '1'");
									while($lista = mysql_fetch_array($query)) { ?> 
									<option value="<?php echo $lista['id_categoria']; ?>"><?php echo $lista['nome_categoria']; ?></option>
								<?php }?>
		          		</select>
					</div>
				</div>
				
				<div class="row">
					<div class="form-group col-md-2">
						<input type="submit" value="Avan&ccedil;ar" class="btn btn-default" name="enviar" onclick="return valida()" >
					</div>
				</div>
			</form>
			</div>
		</div>

		</div><!-- end col md 12 -->
	</div><!-- end row -->
</div>